subroutine fmi_t2efni_iefnm(fmi, t2, iabij, icore, fact)
!
use mod_size
use mod_iop
use mod_ioff
use mod_orbit 
implicit none
!
real*8, intent(in) :: fact
real*4, intent(in) :: fmi(*)
!
real*4, intent(inout) :: t2(*), iabij(*), icore(*)
!
integer :: i, j, a, b, nsize, i0, i1, i2, i3
integer, external :: irpdso
real*8, external :: dnrm2
!this is to do fmi = fij + 0.50*<ef|nm>*t2(ef,ni)
i0 = 1 
i1 = i0 + nvvoo*isd
i2 = i1 + nvvoo*isd
i3 = i2 + nvvoo*isd
!---I<EF|NM>*T2(EF,NI) =FMI
call myicopyso(iabij(ioi3(2)), icore(i0), nioi32)
call isymtrso(iabij(ioi3(2)), icore(i1), vrta, vrta, 1, 1, popa, popa, 1, 0, 1) 
call axpyso(nioi32, -1.d0, icore(i1), 1, icore(i0), 1)
call myicopyso(t2(ioi3(2)), icore(i1), nioi32)
call isymtrso(t2(ioi3(2)), icore(i2), vrta, vrta, 1, 1, popa, popa, 1, 0, 1) 
call axpyso(nioi32, -1.d0, icore(i2), 1, icore(i1), 1)

!call iexpso(iabij(ioi3(1)), icore(i0), vrta, vrta, 0, 0, popa, popa, 0, 1, 1)
!call iexpso(t2(ioi3(1)), icore(i1), vrta, vrta, 0, 0, popa, popa, 0, 1, 1)
call VpqrmVpqrn_to_Vmn(icore(i0), icore(i1), &
                1, 1, vrta, vrta, 1, popa, popa, popa, &
                fmi(ifoo(1)), 1, fact)
!---I<eF|nM>*T2(eF,nI) 
!  =I<Fe|Mn>*T2(Fe,In) = FMI
call VpqrmVpqrn_to_Vmn(iabij(ioi3(2)), t2(ioi3(2)), &
                1, 1, vrta, vrtb, 1, popb, popa, popa, &
                fmi(ifoo(1)), 1, fact*2.d0)
!call isymtrso(iabij(ioi3(2)), icore(i0), vrta, vrtb, 1, 0, popa, popb, 1, 1, 1)
!call isymtrso(t2(ioi3(2)), icore(i1), vrta, vrtb, 1, 0, popa, popb, 1, 1, 1)
!call VpqrmVpqrn_to_Vmn(icore(i0), icore(i1), &
!                1, 1, vrta, vrtb, 1, popb, popa, popa, &
!                fmi(ifoo(1)), 1, fact*2.d0)
!
return
end
